;Target control file
;Written by Darth Android (darthandroid@gmail.com) for use with DASM
#IfNDef "__TARGET__"
  #Define "__TARGET__"
  ;Supported CPUs
  #Enum "CPU","Unknown","Z80"; Not supported yet: "M68K"
  ;Supported Z80 platforms
  #Enum "CPU.Z80","Unknown","TI83P"; Not supported yet: "TI73","TI82","TI83","TI85","TI86"
  ;M68K platforms aren't supported yet
  ;#Enum "CPU.M68K","Unknown","TI89","TI89T","TI92,"V200"
  ;Supported TI83P Shells
  #Enum "CPU.Z80.TI83P","Unknown","TIOS","Ion","Mirage"; Not supported yet: "Crush","DCS","TSE"
  #If $param("target")==""
    .Warn "No target set, using \"Z80.TI83P.TIOS\""
    .SetParam "target","Z80.TI83P.TIOS"
  #EndIf
  .Tokenize $param("target"),"\\."
  ;Determine CPU
  #Switch $upper($token(1))
    #Case "Z80"
      #Define "CPU","Z80"
      #Include "<instrFiles/z80.inc>"
      ;Determine Z80 Platform
      #Switch $upper($token(2))
        #Case "TI83P"
          #Define "Platform","TI83P"
          ;Determine TI83P Shell
          #Switch $upper($token(3))
            #Case "TIOS"
              #Define "Shell","TIOS"
              #Break
            #Case "ION"
              #Define "Shell","Ion"
              #Break
            #Case "MIRAGE"
              #Define "Shell","Mirage"
              #Break
            #Default
              #Define "Shell","Unknown"
              #Break
          #EndSwitch
          #Break
        #Default
          #Define "Platform","Unknown"
          #Break
      #EndSwitch
      #Break
    #Default
      #Define "CPU","Unknown"
      #Break
  #EndSwitch
  #Define "Target",CPU+"."+Platform+"."+Shell
#EndIf